﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using PhoneBook.Infrastructure;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace PhoneBook.Controllers
{
    public class RedisController : Controller
    {
        // GET: /<controller>/
        public string Index()
        {
            RedisHelper redisHelper = new RedisHelper("127.0.0.1:6379");
            string value = "abcdefg";
            bool r1 = redisHelper.SetValue("mykey", value);
            string saveValue = redisHelper.GetValue("mykey");
            bool r2 = redisHelper.SetValue("mykey", "NewValue");
            saveValue = redisHelper.GetValue("mykey");
            bool r3 = redisHelper.DeleteKey("mykey");
            string uncacheValue = redisHelper.GetValue("mykey");
            return uncacheValue;
        }
    }
}
